package gameframework;

import java.awt.Graphics2D;
import java.awt.event.KeyEvent;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Random;

import javax.imageio.ImageIO;

public class ngan {
	//
	Random ran=new Random();
	// mang ngan
	
	//
	public int x_ngan;
    public int y_ngan;
    
    public static BufferedImage hinh_ngan;
    
    private static final double tocdoY_di_chuyen_ban_dau = +2;
	 
    private static double tocdox = tocdoY_di_chuyen_ban_dau;
    
    public ngan()
    {
    	//tao_ngan(xnganmoi,ygnganmoi);
		LoadContent();
		tocdox=+2;
		Initialize();//
    }
    public void Initialize()
	{
		//this.x_ngan=xnganmoi;
		//this.y_ngan=ygnganmoi;
	
		
		
	}
	private void LoadContent()
	{
	     // con ngan
      
        try {
        	  URL ngan_url = this.getClass().getResource("/gameframework/resources/images/ngan.png");
			hinh_ngan = ImageIO.read(ngan_url);
			
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
    public void khoitaolai(int xngantaolai,int yngantaolai)
	{
		this.x_ngan=xngantaolai;
		this.y_ngan=yngantaolai;
		tocdox=+2;
		
	}
    
    public void Drawn(Graphics2D g2d)
	{
		
		g2d.drawImage(hinh_ngan,x_ngan,y_ngan,null);
		 //
        
	}
    public void Update()
	{
		this.x_ngan+=tocdox;
		  
	}
    public void them(int xx,int yy)
    {
    	this.x_ngan=xx;
    	this.y_ngan=yy;
    	
    }
    
}
